package lhc_front_api.test;

import java.util.HashMap;
import java.util.Map;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.lhc.service.service.testService;
import com.lhc.service.util.FrontStatusConstants;
import com.lhc.service.util.Response;


@Controller
@RequestMapping("/lhc/front/user")
public class testCoroller {

	private final Logger logger = Logger.getLogger(getClass());
	
	@Autowired
	private testService testService;
	
	@ResponseBody
	@RequestMapping(method = { RequestMethod.GET,RequestMethod.POST }, value = { "/testFindUserMsg" })
	public String testFindUserMsg(){
		try {
			logger.info("测试开始");
			Map<String, Object> map= new HashMap<String, Object>();
			map.put("phone","13552005545");
			Map<String, Object> userMsg = testService.findUserMsg(map);
			return Response.build().setStatus(FrontStatusConstants.Common.SUCCESS.status).setData(userMsg)
					.setMessage(FrontStatusConstants.Common.SUCCESS.message).toJSON();
			
			
		} catch (Exception e) {
			e.printStackTrace();
			logger.info("查询用户信息失败");
			return Response.build().setStatus(FrontStatusConstants.Common.SYSTEM_ERROE.status)
					.setMessage(FrontStatusConstants.Common.SYSTEM_ERROE.message).toJSON();
		}
	}
}
